﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Root.master" AutoEventWireup="true" CodeFile="Persons.aspx.cs" Inherits="Default2" %>

<%@ Register assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxFormLayout" tagprefix="dx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Content" Runat="Server">
    <dx:ASPxGridViewExporter ID="gridExport" runat="server" GridViewID="grd1"></dx:ASPxGridViewExporter>
    <dx:ASPxPanel ID="ASPxPanel1" runat="server" Width="200px">
    </dx:ASPxPanel>
    <table cellpadding="0" cellspacing="0" style="margin-top: 10px; margin-left: 13px;">
        <tr>
            <td style="padding-right: 4px">
               <dx:ASPxButton runat="server" UseSubmitBehavior="False" Text="Редактировать" ID="btn_edit" OnClick="ASPxFormLayout1_E1_Click">
                   <%--<Image Url="~/Content/Images/edit.png"></Image>--%>
               </dx:ASPxButton>
            </td>
            <td style="padding-right: 4px">
                <dx:ASPxButton ID="btnXlsExport" runat="server" Text="Export to XLS" UseSubmitBehavior="False"
                    OnClick="btnXlsExport_Click" />
            </td>
            <td style="padding-right: 4px; width: 125px;">
                <dx:ASPxButton ID="btnXlsxExport" runat="server" Text="Export to XLSX" UseSubmitBehavior="False"
                    OnClick="btnXlsxExport_Click" Width="128px" />
            </td>
        </tr>
    </table>
    <dx:ASPxFormLayout ID="ASPxFormLayout1" runat="server" Height="100%">
        <Items>
            <dx:LayoutItem Caption="Layout Item" ShowCaption="False" Width="100%" Height="100%" VerticalAlign="Top">
                <LayoutItemNestedControlCollection>
                    <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                        <dx:ASPxGridView ID="grd1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource2" KeyboardSupport="True" KeyFieldName="CODE" Width="100%">
                            <Columns>
                                <dx:GridViewCommandColumn ButtonType="Button" ShowInCustomizationForm="True" Visible="False" VisibleIndex="0" Width="60px">
                                    <EditButton Text=" " Visible="True">
                                        <Image Height="16px" Url="~/Content/Images/edit.png" Width="16px">
                                        </Image>
                                    </EditButton>
                                    <CancelButton Text="Отменить" Visible="True">
                                        <Image AlternateText="Отменить" Url="~/Content/Images/close.png">
                                        </Image>
                                    </CancelButton>
                                    <UpdateButton>
                                        <Image Url="~/Content/Images/save.png">
                                        </Image>
                                    </UpdateButton>
                                </dx:GridViewCommandColumn>
                                <dx:GridViewDataTextColumn Caption="Koд" FieldName="CODE" ReadOnly="True" ShowInCustomizationForm="True" VisibleIndex="1" Width="60px">
                                    <EditFormSettings Visible="False" />
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="Фамилия" FieldName="F" ReadOnly="True" ShowInCustomizationForm="True" VisibleIndex="2">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="Имя" FieldName="I" ReadOnly="True" ShowInCustomizationForm="True" VisibleIndex="3">
                                    <EditFormSettings Visible="False" />
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="Отчество" FieldName="O" ReadOnly="True" ShowInCustomizationForm="True" VisibleIndex="4">
                                    <EditFormSettings Visible="False" />
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataDateColumn FieldName="BORN" ShowInCustomizationForm="True" Visible="False" VisibleIndex="5">
                                    <EditFormSettings Visible="True" />
                                </dx:GridViewDataDateColumn>
                                <dx:GridViewDataTextColumn FieldName="EMAIL" ShowInCustomizationForm="True" VisibleIndex="6">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="Пароль" FieldName="PSWD" ShowInCustomizationForm="True" VisibleIndex="7" Visible="false">
                                    <EditFormSettings Caption="Пароль" Visible="True" />
                                </dx:GridViewDataTextColumn>
                            </Columns>
                            <SettingsBehavior AllowFocusedRow="True" AllowSelectByRowClick="True" ColumnResizeMode="Control" EnableCustomizationWindow="True" />
                            <SettingsPager PageSize="15">
                                <PageSizeItemSettings Visible="True">
                                </PageSizeItemSettings>
                            </SettingsPager>
                            <SettingsEditing Mode="PopupEditForm" />
                            <Settings ShowFilterBar="Auto" ShowFilterRow="True" ShowHeaderFilterButton="True" />
                            <SettingsLoadingPanel Delay="50" />
                            <SettingsCookies CookiesID="piplegrd" />
                            <SettingsPopup>
                                <EditForm AllowResize="True" HorizontalAlign="LeftSides" Width="600px" />
                            </SettingsPopup>
                        </dx:ASPxGridView>
                    </dx:LayoutItemNestedControlContainer>
                </LayoutItemNestedControlCollection>
            </dx:LayoutItem>
            <dx:LayoutItem Caption="Layout Item" ShowCaption="False" Width="100%">
                <LayoutItemNestedControlCollection>
                    <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConflictDetection="CompareAllValues" ConnectionString="<%$ ConnectionStrings:ConnectionStringDez %>" 
                            DeleteCommand="DELETE FROM &quot;PIPLE&quot; WHERE &quot;CODE&quot; = ? AND ((&quot;F&quot; = ?) OR (&quot;F&quot; IS NULL AND ? IS NULL)) AND ((&quot;I&quot; = ?) OR (&quot;I&quot; IS NULL AND ? IS NULL)) AND ((&quot;O&quot; = ?) OR (&quot;O&quot; IS NULL AND ? IS NULL)) AND ((&quot;BORN&quot; = ?) OR (&quot;BORN&quot; IS NULL AND ? IS NULL)) AND ((&quot;EMAIL&quot; = ?) OR (&quot;EMAIL&quot; IS NULL AND ? IS NULL)) AND ((&quot;PSWD&quot; = ?) OR (&quot;PSWD&quot; IS NULL AND ? IS NULL))" 
                            InsertCommand="INSERT INTO &quot;PIPLE&quot; (&quot;CODE&quot;, &quot;F&quot;, &quot;I&quot;, &quot;O&quot;, &quot;BORN&quot;, &quot;EMAIL&quot;, &quot;PSWD&quot;) VALUES (?, ?, ?, ?, ?, ?, ?)" OldValuesParameterFormatString="original_{0}" ProviderName="<%$ ConnectionStrings:ConnectionStringDez.ProviderName %>" 
                            SelectCommand="SELECT &quot;CODE&quot;, &quot;F&quot;, &quot;I&quot;, &quot;O&quot;, &quot;BORN&quot;, &quot;EMAIL&quot;, &quot;PSWD&quot; FROM &quot;PIPLE&quot; ORDER BY &quot;F&quot;, &quot;I&quot;" 
                            UpdateCommand="UPDATE &quot;PIPLE&quot; SET &quot;F&quot; = ?, &quot;I&quot; = ?, &quot;O&quot; = ?, &quot;BORN&quot; = ?, &quot;EMAIL&quot; = ?, &quot;PSWD&quot; = ? WHERE &quot;CODE&quot; = ? AND ((&quot;F&quot; = ?) OR (&quot;F&quot; IS NULL AND ? IS NULL)) AND ((&quot;I&quot; = ?) OR (&quot;I&quot; IS NULL AND ? IS NULL)) AND ((&quot;O&quot; = ?) OR (&quot;O&quot; IS NULL AND ? IS NULL)) AND ((&quot;BORN&quot; = ?) OR (&quot;BORN&quot; IS NULL AND ? IS NULL)) AND ((&quot;EMAIL&quot; = ?) OR (&quot;EMAIL&quot; IS NULL AND ? IS NULL)) AND ((&quot;PSWD&quot; = ?) OR (&quot;PSWD&quot; IS NULL AND ? IS NULL))">
                            <DeleteParameters>
                                <asp:Parameter Name="original_CODE" Type="Int32" />
                                <asp:Parameter Name="original_F" Type="String" />
                                <asp:Parameter Name="original_F" Type="String" />
                                <asp:Parameter Name="original_I" Type="String" />
                                <asp:Parameter Name="original_I" Type="String" />
                                <asp:Parameter Name="original_O" Type="String" />
                                <asp:Parameter Name="original_O" Type="String" />
                                <asp:Parameter Name="original_BORN" Type="DateTime" />
                                <asp:Parameter Name="original_BORN" Type="DateTime" />
                                <asp:Parameter Name="original_EMAIL" Type="String" />
                                <asp:Parameter Name="original_EMAIL" Type="String" />
                                <asp:Parameter Name="original_PSWD" Type="String" />
                                <asp:Parameter Name="original_PSWD" Type="String" />
                            </DeleteParameters>
                            <InsertParameters>
                                <asp:Parameter Name="CODE" Type="Int32" />
                                <asp:Parameter Name="F" Type="String" />
                                <asp:Parameter Name="I" Type="String" />
                                <asp:Parameter Name="O" Type="String" />
                                <asp:Parameter Name="BORN" Type="DateTime" />
                                <asp:Parameter Name="EMAIL" Type="String" />
                                <asp:Parameter Name="PSWD" Type="String" />
                            </InsertParameters>
                            <UpdateParameters>
                                <asp:Parameter Name="F" Type="String" />
                                <asp:Parameter Name="I" Type="String" />
                                <asp:Parameter Name="O" Type="String" />
                                <asp:Parameter Name="BORN" Type="DateTime" />
                                <asp:Parameter Name="EMAIL" Type="String" />
                                <asp:Parameter Name="PSWD" Type="String" />
                                <asp:Parameter Name="original_CODE" Type="Int32" />
                                <asp:Parameter Name="original_F" Type="String" />
                                <asp:Parameter Name="original_F" Type="String" />
                                <asp:Parameter Name="original_I" Type="String" />
                                <asp:Parameter Name="original_I" Type="String" />
                                <asp:Parameter Name="original_O" Type="String" />
                                <asp:Parameter Name="original_O" Type="String" />
                                <asp:Parameter Name="original_BORN" Type="DateTime" />
                                <asp:Parameter Name="original_BORN" Type="DateTime" />
                                <asp:Parameter Name="original_EMAIL" Type="String" />
                                <asp:Parameter Name="original_EMAIL" Type="String" />
                                <asp:Parameter Name="original_PSWD" Type="String" />
                                <asp:Parameter Name="original_PSWD" Type="String" />
                            </UpdateParameters>
                        </asp:SqlDataSource>
                    </dx:LayoutItemNestedControlContainer>
                </LayoutItemNestedControlCollection>
            </dx:LayoutItem>
        </Items>
        <SettingsItems Height="100%" Width="100%" />
    </dx:ASPxFormLayout>
</asp:Content>

